<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button onclick="ok()">获取固定状态的执行情况</button>
    <script>
        // var p1 = Promise.resolve("i am ok!");
        var p1 = Promise.reject("i am no ok!");
        ok();
        function ok() {
            p1.then(r => {
                console.log(r);
            })
            .catch(r => {
                console.log(r);
            })
        }

    </script>
</body>

</html>